package org.scratchcrew.domain;

import javax.persistence.AttributeOverride;
import javax.persistence.AttributeOverrides;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;

@Entity
@Table(name = "t_private_boards", uniqueConstraints = { @UniqueConstraint(columnNames = {
		"user_id", "name" }) })
@AttributeOverrides(value = { @AttributeOverride(column = @Column(name = "private_board_id"), name = "id") })
public class PrivateBoard extends Board {
	@Column(name = "name", nullable = false)
	private String name;

	@ManyToOne(optional = false)
	@JoinColumn(name = "user_id", nullable = false)
	private User owner;

	public User getOwner() {
		return owner;
	}

	public void setOwner(User owner) {
		this.owner = owner;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

}
